import {
	http
} from '/utils/http.js'

//开发使用
export const postLoginWxMinSimpleAPI = (phone) => {
	return http({
		method: 'GET',
		url: 'https://huaqing.xgxtravel.com/api/common/getUserInfo',
		data: {
			phone,
		},
	})
}
//微信授权登录
export const postLoginWxMinAPI = (data) => {
	return http({
		method: 'POST',
		url: '/api/login/wxMin',
		data: data,
		header: {
			'content-type': 'application/json' // 设置数据类型为 json
		}
	})
}

//通过手机号获取用户信息
export const getUserInfoByPhoneAPI = (phone) => {
	return http({
		method: 'POST',
		url: '/api/common/getUserInfo',
		data: {
			phone,
		},
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		}
	})
}


//测试获取key
export const getKeyAPI = (appid, secret, js_code, grant_type) => {
	return http({
		method: 'GET',
		url: 'https://api.weixin.qq.com/sns/jscode2session',
		data: {
			appid,
			secret,
			js_code,
			grant_type
		}
	})
}